//package com.wanwu.channel.service.strategy.handle.allianpay;
//import com.google.common.collect.Lists;
//
//
//import com.wanwu.channel.common.enums.ExceptionEnum;
//import com.wanwu.channel.common.exception.SystemException;
//import com.wanwu.channel.common.util.LogUtil;
//import com.wanwu.channel.core.ClearService;
//import com.wanwu.channel.dao.entity.ChannelClearEntity;
//import com.wanwu.channel.remote.allinpay.TLHttpUtils.TLRspCodx;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.stereotype.Service;
//
//import javax.annotation.Resource;
//
//import static com.wanwu.channel.remote.allinpay.TLHttp.*;
//
///**
// * @author JiWen
// * @time 2020/1/21 15:13
// * 第二步 提交申请材料
// */
//@Service("declareSubmitHandler")
//public class DeclareSubmitHandler implements Handler {
//    public static Logger logger = LoggerFactory.getLogger(DeclareSubmitHandler.class);
//    @Resource
//    private ClearService clearService;
//
//    @Override
//    public void handle(AliianPayContext context) {
//        ChannelClearEntity clearEntity = context.getClearEntity();
//        String ext2 = clearEntity.getExt2();
//        if (StepEnum.DECLARE_SUBMIT.getCode() != Integer.parseInt(ext2)) {
//            return;
//        }
//        try {
//            SubmitApplyDetailReq req = toSubmitApplyDetailReq(clearEntity);
//            SubmitApplyDetailResp resp = (SubmitApplyDetailResp) request(BizTypeEnum.SUBMIT_DETAIL, req);
//            if (TLRspCodx.REQ_SUCC.equals(resp.getRspcode())) {
//                clearEntity.setExt2(String.valueOf(StepEnum.APPLY_QUERY1.getCode()));
//                clearService.updateChannelClear(clearEntity);
//            }
//        } catch (Exception e) {
//            LogUtil.error(logger, e, "通联提交申请材料发送异常");
//            throw new SystemException(ExceptionEnum.E10021);
//        }
//    }
//
//
//    private SubmitApplyDetailReq toSubmitApplyDetailReq(ChannelClearEntity entity){
//        SubmitApplyDetailReq req= new SubmitApplyDetailReq();
//        req.setApplyId(entity.getExt1());
//        // TODO 拼接提交申请材料报文
//        req.setDcls(Lists.newArrayList());
//        return req;
//    }
//}
